import request from '@/utils/request'
import {parseStrEmpty} from "@/utils/smart";

export function listPlots(userId){
  return request({
    url: '/system/plot/listPlots/'  + userId,
    method: 'get'
  })
}

export function plotList(formInline){
  return request({
    url: '/system/plot/plotList',
    method: 'get',
    params:formInline
  })
}

export function updatePlot(data){
  return request({
    url: `/system/plot/updatePlot`, // 注意 URL 中包含路径参数 {id}
    method: 'put', // 使用 PUT 方法
    data // 传递需要更新的数据
  })
}

export function addPlot(data){
  return request({
    url: '/system/plot/addPlot',
    method: 'post',
    data
  })
}

export function deletePlot(id){
  return request({
    url: '/system/plot/deletePlot/' + id,
    method: 'delete'
  })
}

export function getPlotById(id){
  return request({
    url: `/system/plot/getPlotById/` + id,
    method: 'get'
  })
}

export function homeDate(){
  return request({
    url: `/system/homeDate`,
    method: 'get'
  })
}


// 下拉框 大全


export function queryFloors(){
  return request({
    url: `/system/floors/queryFloors`,
    method: 'get'
  })
}

export function queryBuildings(){
  return request({
    url: `/system/buildings/queryBuildings`,
    method: 'get'
  })
}

export function queryUnits(){
  return request({
    url: `/system/unit/queryUnits`,
    method: 'get'
  })
}


/*export function queryAllList(){
  return request({
    url: `/system/queryAllList`,
    method: 'get'
  })
}*/

export function residentsQuery4Count(){
  return request({
    url: `/system/residentsQuery4Count`,
    method: 'get'
  })
}
export function vehiclesQuery4Count(){
  return request({
    url: `/system/vehiclesQuery4Count`,
    method: 'get'
  })
}
export function estateQuery4Count(){
  return request({
    url: `/system/estateQuery4Count`,
    method: 'get'
  })
}
export function devicesQuery4Count(){
  return request({
    url: `/system/devicesQuery4Count`,
    method: 'get'
  })
}
export function unitCategoriesQuery4Count(){
  return request({
    url: `/system/unitCategoriesQuery4Count`,
    method: 'get'
  })
}
export function plotQuery4Count(){
  return request({
    url: `/system/plotQuery4Count`,
    method: 'get'
  })
}
export function queryAllList(){
  return request({
    url: `/system/plotQuery4Count`,
    method: 'get'
  })
}

export function threeLevelAreasList(){
  return request({
    url: `/system/threeLevelAreasList`,
    method: 'get'
  })
}



